﻿@model Bug315.Models.WorkItemIndexVm
@{
    //Layout = null;
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>@Model.Count - @Model.WelcomeMessage</h1>
    <div>
        <table class="table table-bordered">
            <thead>
                <tr>
                    <td>Task/Bug</td>
                    <td>Priority</td>
                    <td>TYPE</td>
                    <td>Actions</td>
                </tr>
            </thead>
            @foreach (var buggy in Model.WorkItemList)
            {
                <tr>
                    <td>@buggy.Title</td>
                    <td>@buggy.Priority</td>
                    <td>@buggy.GetType().Name</td>
                    <td>@Html.ActionLink("Edit", "Update", "Home", new { id = buggy.Id }, new { @class = "btn btn-warning" }) @Html.ActionLink("Delete", "Delete", "Home", new { id = buggy.Id }, new { @class = "btn btn-danger" })</td>
                </tr>
            }
        </table>
    </div>
</div>

<div class="row">
    <div class="col-md-4">
        <h2>BUG</h2>
        @foreach(var b in Model.BugList){
            <div>@b.Title <br /> @b.StepsToReproduce</div>
            <hr/>
        }
    </div>
    <div class="col-md-4">
        <h2>Tasks</h2>
        @foreach (var b in Model.TaskList)
        {
            <div>@b.Title <br /> @b.Description</div>
            <hr/>
        }
    </div>
    
</div>

<hr />

<div class="container">

    <button onclick="myContacts.doRandomizer()" type="button" class="btn btn-warning btn-xs"> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>Randomize</button>

    <div class="container col-md-4">
        <!-- main contain -->
        <div>
            <label>First Name</label>
            <input id="cFname" class="form-control" type="text" name="First Name" value="" placeholder="Your First name" />
            <br />
            <label>Last Name</label>
            <input id="cLname" class="form-control" type="text" name="Last Name" value="" placeholder="Your Last name" />
            <br />
            <label>Phone</label>
            <input id="cPhone" class="form-control" type="tel" name="Phone" value="" placeholder="(555)555-5555" />
            <br />
            <label>Email</label>
            <input id="cEmail" class="form-control" type="email" name="Email" value="" placeholder="you@company.com" />
            <br />
            <button type="submit" class="btn btn-danger" onclick="myContacts.doAdd()">Add Contact</button>
        </div>

        <div>
            <ul id="results"></ul>
        </div>



    </div><!-- / main contain -->
    <!-- Table for contact -->
    <div class="container col-md-4">
        <table class="table table-striped table-bordered table-condensed" id="tableResults">

            <!-- render content here -->

        </table>
    </div>
    <!-- Table for random contacts -->
    <div class="container col-md-4">
        <table class="table table-striped table-bordered table-condensed" id="tableShuffledResults">

            <!-- render content here -->

        </table>
    </div>


    <!-- actual modal -->
    <div id="myEditModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">

        <div class="modal-dialog modal-sm">
            <div class="modal-content">

                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title" id="mySmallModalLabel">Edit Contact</h4>
                </div>
                <div class="modal-body">
                    <!-- edit form -->
                    <div>
                        <label>First Name</label>
                        <input id="uFname" class="form-control" type="text" name="First Name" value="" placeholder="Your First name" />
                        <br />
                        <label>Last Name</label>
                        <input id="uLname" class="form-control" type="text" name="Last Name" value="" placeholder="Your Last name" />
                        <br />
                        <label>Phone</label>
                        <input id="uPhone" class="form-control" type="tel" name="Phone" value="" placeholder="(555)555-5555" />
                        <br />
                        <label>Email</label>
                        <input id="uEmail" class="form-control" type="email" name="Email" value="" placeholder="you@company.com" />
                        <br />
                        <button type="submit" class="btn btn-warning" data-dismiss="modal" onclick="myContacts.doSave()">Save</button>
                    </div>
                    <!-- / edit form -->
                </div>
            </div><!-- /.modal-content -->
        </div>

    </div>


</div>